<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCaConsultationWays extends \App\Utils\CreateMigration
{
    function columns(Blueprint $table)
    {
        $table->string('name')->nullable()->comment('名称');
        $table->string('code')->nullable()->comment('编码');
        $table->string('sequence')->nullable()->comment('编码');
        $table->unsignedBigInteger('pid')->default(0)->comment('上一级编号');
        $table->decimal('weight')->default(99)->comment('权重（值越大排序越前）');
        $table->unsignedBigInteger('hospital_id')->default(0)->comment('医院编号');
        $table->index(['hospital_id', 'weight','pid'], 'idx_hospital_weight_pid');
    }

    function tableInfo()
    {
        return ['ca__consultation_ways', '咨询预约-来院方式'];
    }

}
